home *** CD-ROM | disk | FTP | other *** search
-
-
-
- FFFFSSSSEEEEEEEEKKKK((((3333SSSS)))) FFFFSSSSEEEEEEEEKKKK((((3333SSSS))))
-
-
-
- NNNNAAAAMMMMEEEE
- fseek, fseek64, rewind, ftell, ftell64 - reposition a file pointer in a
- stream
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssttttddddiiiioooo....hhhh>>>>
-
- iiiinnnntttt ffffsssseeeeeeeekkkk ((((FFFFIIIILLLLEEEE ****ssssttttrrrreeeeaaaammmm,,,, lllloooonnnngggg ooooffffffffsssseeeetttt,,,, iiiinnnntttt wwwwhhhheeeennnncccceeee))));;;;
-
- iiiinnnntttt ffffsssseeeeeeeekkkk66664444 ((((FFFFIIIILLLLEEEE ****ssssttttrrrreeeeaaaammmm,,,, lllloooonnnngggg lllloooonnnngggg ooooffffffffsssseeeetttt,,,, iiiinnnntttt wwwwhhhheeeennnncccceeee))));;;;
-
- vvvvooooiiiidddd rrrreeeewwwwiiiinnnndddd ((((FFFFIIIILLLLEEEE ****ssssttttrrrreeeeaaaammmm))));;;;
-
- lllloooonnnngggg fffftttteeeellllllll ((((FFFFIIIILLLLEEEE ****ssssttttrrrreeeeaaaammmm))));;;;
-
- lllloooonnnngggg lllloooonnnngggg fffftttteeeellllllll66664444 ((((FFFFIIIILLLLEEEE ****ssssttttrrrreeeeaaaammmm))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _f_s_e_e_k sets the file position indicator for the stream pointed to by
- _s_t_r_e_a_m. The new position, measured in bytes from the beginning of the
- file, is obtained by adding _o_f_f_s_e_t to the position specified by _w_h_e_n_c_e.
-
- _S_E_E_K__S_E_T specified starting point is the beginning of the file plus
- _o_f_f_s_e_t.
-
- _S_E_E_K__C_U_R starting point is the current value of the file position
- indicator plus _o_f_f_s_e_t.
-
- _S_E_E_K__E_N_D specified starting point is the _E_O_F of the file plus _o_f_f_s_e_t.
-
- A successful call to _f_s_e_e_k clears the end-of-file indicator for the
- stream.
-
- _f_s_e_e_k allows the file position indicator to be set beyond the end of the
- existing data in the file. If data is later written at this point,
- subsequent reads of data in the gap will return zero until data is
- actually written into the gap. _f_s_e_e_k, by itself, does not extend the
- size of the file.
-
- _r_e_w_i_n_d(_s_t_r_e_a_m) is equivalent to:
-
- (_v_o_i_d) _f_s_e_e_k ( _s_t_r_e_a_m , _0_L, _S_E_E_K__S_E_T),
-
- except that the error indicator for the stream is also cleared. Also,
- _r_e_w_i_n_d returns no value.
-
- _f_s_e_e_k and _r_e_w_i_n_d undo any effects of _u_n_g_e_t_c(3S) on the indicated _s_t_r_e_a_m.
- After _f_s_e_e_k or _r_e_w_i_n_d, the next operation on a file opened for update may
- be either input or output.
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- FFFFSSSSEEEEEEEEKKKK((((3333SSSS)))) FFFFSSSSEEEEEEEEKKKK((((3333SSSS))))
-
-
-
- If _s_t_r_e_a_m is writable and buffered data has not been written to the
- underlying file, _f_s_e_e_k and _r_e_w_i_n_d cause the unwritten data to be written
- to the file.
-
- _f_t_e_l_l returns the offset of the current byte relative to the beginning of
- the file associated with the named _s_t_r_e_a_m.
-
- The functions _f_s_e_e_k_6_4 and _f_t_e_l_l_6_4 are identical to _f_s_e_e_k and _f_t_e_l_l
- respectively, except that _f_s_e_e_k_6_4 takes a _l_o_n_g _l_o_n_g as an argument and
- _f_t_e_l_l_6_4 returns a _l_o_n_g _l_o_n_g. This allows the routines to set and return
- the file position indicator for files larger than 2 Gigabytes.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- lseek(2), fopen(3S), fsetpos(3S), popen(3S), stdio(3S), ungetc(3S).
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- _f_s_e_e_k returns non-zero for improper seeks, otherwise zero. An improper
- seek can be, for example, an _f_s_e_e_k done on a file that has not been
- opened via _f_o_p_e_n; in particular, _f_s_e_e_k may not be used on a terminal, or
- on a file opened via _p_o_p_e_n(3S).
-
- WWWWAAAARRRRNNNNIIIINNNNGGGG
- The ANSI C Standard restricts the use of _o_f_f_s_e_ts, when _s_t_r_e_a_m refers to a
- text file. When operating on these files, the value of _o_f_f_s_e_t must be
- zero unless _w_h_e_n_c_e is SSSSEEEEEEEEKKKK____SSSSEEEETTTT. This restriction is necessary as the
- unit of _o_f_f_s_e_ts may not be bytes on some systems, and arithmetic may not
- meaningfully be performed on them.
- As the unit of _o_f_f_s_e_t on this system (and on most UNIX systems) is bytes
- for text as well as for binary files, the restrictions indicated in the
- ANSI C Standard are not enforced. Portable programs, however, should be
- coded accordingly.
-
- Users of the -_n_3_2 compilation model are directed to either use _f_t_e_l_l_6_4
- and _f_s_e_e_k_6_4 or _f_g_e_t_p_o_s and _f_s_e_t_p_o_s in place of _f_t_e_l_l and _f_s_e_e_k. The
- reason for this is because the _o_f_f_s_e_t argument to _f_s_e_e_k, and the return
- value from _f_t_e_l_l are both typed as _l_o_n_g, which is not sufficient to
- express the maximum file length supported by the -_n_3_2 compilation model.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-